<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>

<body>
<?php
require_once '../../inc.php';
echo PHP_VERSION;

$fn=new Clfn(__FILE__);
$fn->requireOnce(array(
"../../"."inc/clscandir.cls.php",
"../../"."inc/cltranscoding.cls.php"
));
$fn->requireOnce("../../inc/exinc/");

$tab=new Cltable();
 
 
?>
 <?php
 $err=new clerror();
// $err->setErrorHandler();
class clerror_ex{
    public static $cltab;
	public function __construct(){
	    self::$cltab=new Cltable();	
		$this->setErrorHandler();
	}
	public function __destruct(){}	
	public function setErrorHandler(){
	    set_error_handler ('clerror::errorHandler');
    }
	public static function errorHandler (
	$error_level, $error_message, $file, $line,$error_context) {
		global $tab;
    switch ($error_level) {
		//提醒级别
        case E_NOTICE:
		 $error_type = 'E_NOTICE';
            break;
        case E_USER_NOTICE:
            $error_type = 'E_USER_NOTICE';
            break;
		
		//警告级别
        case E_WARNING:
		$error_type = 'E_WARNING';
            break;
        case E_USER_WARNING:
            $error_type = 'E_USER_WARNING';
            break;
		
		//错误级别
        case E_ERROR:
		    $error_type = 'E_ERROR';
            break;
        case E_USER_ERROR:
            $error_type = 'E_USER_ERROR';
            $EXIT = TRUE;
            break;
		
		//其他未知错误
        default:
            $error_type = '['.$error_level.']';
            $EXIT = TRUE;
            break;
    }
 
	if(array_key_exists("php_errormsg", $error_context)){
		$php_errormsg=$error_context['php_errormsg'];
	}else{
	    $php_errormsg='';	
	}
	
	$tab->export (array(
	'level'=>$error_level,
	'type'=>$error_type,
	'message'=>$error_message,
	'file'=>$file, 
	'line'=>$line,
	'error_context'=> $php_errormsg
	 ));
 
        return false;
     }
}
 


#使用未定义的变量要报 notice 的
echo $novar;
#除以0要报警告的
echo 3/0;
#自定义一个错误
//trigger_error ('Trigger a fatal error', E_USER_ERROR); 
 echo $gkgl;

mysql_connect('127.0.0.1','root','');
adfasffa();

?>
</body>
</html>